package com.zaofan.dao;

import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;

import com.zaofan.bean.Recharge;
import com.zaofan.constant.StateConstant;
import com.zaofan.dao.base.DaoSupportImpl;

public class RechargeDao extends DaoSupportImpl<Recharge> {

	public void payByAdmin(String rechargeNo) {
		try {
			String sql = "update " + Recharge.class.getSimpleName().toLowerCase() + " set payState = "
					+ StateConstant.ORDER_PAY_STATE_PAY + ",state = " + StateConstant.ORDER_STATE_PAY
					+ ",payType='管理员支付操作' where rechargeNo = '" + rechargeNo + "'";
			System.err.println(sql);
			QueryRunner runner = new QueryRunner(getDataSource());
			runner.update(sql);
		} catch (SQLException e) {
			e.printStackTrace();
		}

	}

}
